MsgN("-- processes.lua loaded")

MDRP.Processes = {}

function MDRP.AddProcess( name, process )
	MDRP.Processes[name] = process
end



local PROCESS = {}

function PROCESS:Start( )

	self.StartTime = CurTime()
	--self.Owner:Freeze( true )
	self:Update()

end

function PROCESS:Update()
	if self.Time < (CurTime() - self.StartTime) then return end

	if (!self.Owner:Alive()) then self:Kill() end

	self.Owner:GetActiveWeapon():SendWeaponAnim(ACT_VM_HITCENTER)
	self.Owner:EmitSound(Sound("physics/wood/wood_solid_impact_bullet"..tostring(math.random(1,5))..".wav"))

	--timer.Simple((self.Time/3), self.Update, self)
end

--for whatever reason, process needs to stop early
function PROCESS:Kill()
	self.Owner:Freeze( false )
end

function PROCESS:Stop()




	--[[
		TODO:
		Add a count on the prop to where it can only be used a certain amount of times
	]]

	--self.Owner:Freeze( false )
end

MDRP.AddProcess( "WoodCutting", PROCESS )
